/*
 * Link.h
 *
 *  Created on: 16/10/2011
 *      Author: godinho
 */

#ifndef LINK_H_
#define LINK_H_

namespace localview {

class Node;

/**
 * A link represents possible movement of a car on an intersection.
 *
 * It just says that a car can departure from a street X and reach an street Y
 * on an intersection.
 *
 * Objects of this class are immutable.
 */
class Link {
public:
	/**
	 * Constructs a link
	 *
	 * @param from street
	 * @param to street
	 */
	Link(Node* from, Node* to);

	virtual ~Link();

	/**
	 * Target of this links.
	 *
	 * It means that if this link is enabled on an intersection, a car can
	 * use this link to reach the street returned by this method.
	 *
	 * @return target street.
	 */
	Node* getTo();

	/**
	 * Origin of this link.
	 *
	 * Returns the street which is the source of a car on an traffic intersection.
	 *
	 * @return origin street.
	 */
	Node* getFrom();
private:
	Node* mTo;
	Node* mFrom;
};

}

#endif /* LINK_H_ */
